MDropDownList – A drop down text list.


Creation: MDropDownList_New(sortmode, x, y, pixelwidth)


sortmode – Automatic sorting mode. 0=none; 1=Alphabetic; 2=Reverse Alphabetic

Watch out with automatic sorting as large lists will take forever to populate. Use manual sort instead.

x – Pixel X coordinate for the top left corner of the list.

y – Pixel Y coordinate for the top left corner of the list.

pixelwidth – The width of the list in pixels.


Functions:

MDropDownList_AddItem(index, text$, referencekey)

Adds a text string to the list. Optional unique reference key number. 0; some unique number.


MDropDownList_Clear(index)

Clears the entire list of contents.


MDropDownList_ClearSelected(index)

Deselects the currently selected list item.


MDropDownList_Condense(index, mode)

Condenses list removing empty entries. Mode=0, empty text. Mode=1, zero reference key.


MDropDownList_Delete(index)

Deletes the list.


MDropDownList_Disable(index)

Disables the list. Prevents user input changes.


MDropDownList_Draw(index)

Draws the list to screen.


MDropDownList_Enable(index)

Enables the list. Restores user input changes.


MDropDownList_Find(index, text$)

Returns list-index of given string if string is stored in list.


MDropDownList_FindKey(index, referencekey)

Returns list-index of given reference key if it is stored in list.


MDropDownList_GetCount(index)

Returns the number of items in the list.


MDropDownList_GetSelected(index)

Returns string, the text of item selected in the list.


MDropDownList_GetSelectedIndex(index)

Returns the list index of item selected in the list.


MDropDownList_GetSelectedKey(index)

Returns the list reference key of item selected in the list.


MDropDownList_RemoveIndex(index, arrayIndex)

Removes item using literal array index within list. arrayIndex changes if list is sorted. (Fastest)

Returns whether successful 0=no; 1=item removed.


MDropDownList_RemoveItem(index, text$)

Removes item using a matching string. Not effective if list contains string more than once.

Returns whether successful 0=no; 1=item removed.


MDropDownList_RemoveKey(index, referencekey)

Removes item using unique reference key within list. Most reliable method.

Returns whether successful 0=no; 1=item removed.


MDropDownList_SetCaption(index, caption$)

Sets the title text of the list.


MDropDownList_SetSelected(index, list-index)

Sets the selected item of the list.


MDropDownList_SetSelectedKey(index, referencekey)

Sets the selected item of the list to item matching given reference key.


MDropDownList_Sort(index)

Sorts the list alphabetically.


MDropDownList_SortReverse(index)

Sorts the list reverse alphabetically.